UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Tux6XcFwgSOu8opmflrYB7A3e7vp8oS+Kvp4sxCbQdM='
WHERE
key_id = 'b41722357e1a65643f458c45f76a9d447d9ae1cfc3afffe828c1a21f3808180e'
AND (
token = 'Tux6XcFwgSOu8opmflrYB7A3e7vp8oS+Kvp4sxCbQdM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)