UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GgR+ry1h/wVH63xNTVuWyAn0dAEMLXjvYpGQHci2m8c=' 
WHERE 
  key_id = 'e2ad5bbccecef81e25d162ba19e29162b2a638fec50a3efc88fc03ac6e51d955' 
  AND (
    token = 'GgR+ry1h/wVH63xNTVuWyAn0dAEMLXjvYpGQHci2m8c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030