UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5EhS/iLAng6QDbU30UOuyXEguUYOj1ZF25ZxmDHZYZ0='
WHERE
key_id = '471b8bea653333789e9cf84fa4fe865440feabff5e6334ce196fe782deee4372'
AND (
token = '5EhS/iLAng6QDbU30UOuyXEguUYOj1ZF25ZxmDHZYZ0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)