UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NFlLRl5jwrdo6te8kLsmRVoRGJh04MHLnfBzmQ9xvUQ=' 
WHERE 
  key_id = 'c1b125f8890f867d0d555591cc3418f5c3bed9567f51faeb20bf30653b04c3c4' 
  AND (
    token = 'NFlLRl5jwrdo6te8kLsmRVoRGJh04MHLnfBzmQ9xvUQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046