UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eQ2f4XN6ULrB8jqirTsQSoq4BLA9WzdWPi7HPgYb37E=' 
WHERE 
  key_id = '644e1b0ef134290dae32809deebe4351e4849d687a0cfda96037a7a13187c8be' 
  AND (
    token = 'eQ2f4XN6ULrB8jqirTsQSoq4BLA9WzdWPi7HPgYb37E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021