UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6/bmXb6b8RxzZ0uGU6+yqvsqShQtyhTF7U76IUuQVHE='
WHERE
key_id = '099204526d9d3d9c76ec8d659e032fc663cdf5a4097361e68202cab27ccfa52e'
AND (
token = '6/bmXb6b8RxzZ0uGU6+yqvsqShQtyhTF7U76IUuQVHE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)