UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0m3vc5VnvcjmzqvGSX7PPUkdbL72V4OMmd8AJSaoQn8=' 
WHERE 
  key_id = '3fb6bb267869dfe5cdb1ff1933f56c42973f422b3267cb3fe60dc9d85f1b1ca7' 
  AND (
    token = '0m3vc5VnvcjmzqvGSX7PPUkdbL72V4OMmd8AJSaoQn8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021