UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Nsj3YhgpXgi3FJL7UVd7sIoASfaYapif/07vJ155NGo='
WHERE
key_id = 'da549b3b55eabec4f70b6d440bd14684ff4117ae8aa3012140864b0ed5575f54'
AND (
token = 'Nsj3YhgpXgi3FJL7UVd7sIoASfaYapif/07vJ155NGo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)