UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2vQY8IKQ8blecslRdNxIAEj4+IM/VSZNnJd7rgavhH0='
WHERE
key_id = 'ecb5e7385e4b725adedc51bf0f89e8d762a5d18976f180bada14b4d980f8b344'
AND (
token = '2vQY8IKQ8blecslRdNxIAEj4+IM/VSZNnJd7rgavhH0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)