UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2FEASaAXmMh4/r0uuuwW3N7K5IYvZXutxdzq0iRJtRI='
WHERE
key_id = '474dac53f553991c1c0ce5c3ef3e6df387919c3d7615da40f4a3ac421dd08f03'
AND (
token = '2FEASaAXmMh4/r0uuuwW3N7K5IYvZXutxdzq0iRJtRI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)