UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yNlcPG/Tt9CsWMMnqSRMZha3vuYaIbKkIwkGvDcdR1k='
WHERE
key_id = 'a863548e665f6d80743acb846cbed04430e628d9d7c9b62a150d514f8a566723'
AND (
token = 'yNlcPG/Tt9CsWMMnqSRMZha3vuYaIbKkIwkGvDcdR1k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)