UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mdkk7Mj7M9wY72xjxz/ih7UOlwrlV0Dhz3orFtezyaw='
WHERE
key_id = 'fc96d61fb1c91df4af8e3ad8b34b3affb121f9f4b8246c9ac855b0fa907752bb'
AND (
token = 'mdkk7Mj7M9wY72xjxz/ih7UOlwrlV0Dhz3orFtezyaw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)