UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ODsyYmCnXVFsCrgQbXe3Ubjl2DvMsZ3Um9agX468aKI='
WHERE
key_id = 'eae8edd6e82ca9b760a04b0c9fc1811e0c2fbc7352e13f456ccaa3beb99303ce'
AND (
token = 'ODsyYmCnXVFsCrgQbXe3Ubjl2DvMsZ3Um9agX468aKI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)