UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'F86Te0j1AEPytkbdYBJtaMzyP1t1wyxIlvRM4cworn4=' 
WHERE 
  key_id = '4337a325f83fb7144ee5bb77cf6027b66b0e3fc8e07a8fa09a2cf319f20dc133' 
  AND (
    token = 'F86Te0j1AEPytkbdYBJtaMzyP1t1wyxIlvRM4cworn4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022