UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lSIJwpqQ5IaCqqAvE+WCruG91RVkw0BOQQJNlAl8yws=' 
WHERE 
  key_id = 'eabb6cfd4b09fa4dc420027204c1a554a996db495713475fc38c6df363f9060a' 
  AND (
    token = 'lSIJwpqQ5IaCqqAvE+WCruG91RVkw0BOQQJNlAl8yws=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033