UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Xs1Qi+aYH7D8fQhNFvPBwmR6S14Q5GFCYQasC2salFI=' 
WHERE 
  key_id = '5d5eb837536d91cde96c3c832f3921faf3e34d15070fac754c0f2ce6bb02d06c' 
  AND (
    token = 'Xs1Qi+aYH7D8fQhNFvPBwmR6S14Q5GFCYQasC2salFI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024