UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '41Oy8skpLwn1fU8YzBNseqbfQDZuzZtTjjuxQUZEfdA='
WHERE
key_id = '29ef4b51b983d632bbbe0d792801bc0e0549698e1708d7854bba53df8d564b22'
AND (
token = '41Oy8skpLwn1fU8YzBNseqbfQDZuzZtTjjuxQUZEfdA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)