UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kg+szFrqZ29G0ZpvxYACp21VgLcp/HTjGdH/1jA5+sg=' 
WHERE 
  key_id = 'e633d7336f264122639b6aa6718096e903907dc173c2ea56fe2ae308da511f0c' 
  AND (
    token = 'kg+szFrqZ29G0ZpvxYACp21VgLcp/HTjGdH/1jA5+sg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019