UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JbedcrNlMkcKjhS7zD9ugOpe4Zo4n+8xi6OkUWrsgzw=' 
WHERE 
  key_id = '05bb5cf2b35c79ba0e5dd10d3bbdec5c006434a9e233d56dc431fe46477cf67c' 
  AND (
    token = 'JbedcrNlMkcKjhS7zD9ugOpe4Zo4n+8xi6OkUWrsgzw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044