UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0j/7XIAmv4t9peYYD0BFvcjAahb9KiJIkBwMcQPcca4=' 
WHERE 
  key_id = 'c4a3313f8d455bc7a577f0e76ce60c73ded504da3c2d7aabcbc90306cb039456' 
  AND (
    token = '0j/7XIAmv4t9peYYD0BFvcjAahb9KiJIkBwMcQPcca4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050