UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LWKzR2ikGnduZsXIpwo3A3cxtgQgv2u5ilWiScJqERA='
WHERE
key_id = '1fe6f42d06f92b22fd11a925a6b03b9590eef334609402bb37e47244d5056236'
AND (
token = 'LWKzR2ikGnduZsXIpwo3A3cxtgQgv2u5ilWiScJqERA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)