UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PzmWLr5GoBgzKAF3ErvLydTHh9naYwMiZT/kBFZ4FkY=' 
WHERE 
  key_id = '9f99f75cc3e255a7a69505ab3dc86d1928abe0f67a962d03521c2e326c8d964d' 
  AND (
    token = 'PzmWLr5GoBgzKAF3ErvLydTHh9naYwMiZT/kBFZ4FkY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025