UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'F2Dwlfjat+zQ6fIN1Td6vciOKe4fBQjOMrjYjrWdyBQ=' 
WHERE 
  key_id = 'd397e1e2755a6fdfe599cbaa3caf8593f3e3b27dfe07e9e1472b6fd213cf8150' 
  AND (
    token = 'F2Dwlfjat+zQ6fIN1Td6vciOKe4fBQjOMrjYjrWdyBQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045