UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UWpWcGG3Y/YUbEGt4AyUsJwsJQ7z27We3nRf28L8fDY=' 
WHERE 
  key_id = '56fe2ba102534e9780e95f807c0de52ff63d387cde0e570e69846f574cf7c182' 
  AND (
    token = 'UWpWcGG3Y/YUbEGt4AyUsJwsJQ7z27We3nRf28L8fDY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025