UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xTp0qXe7RnQ9myzR59QMCGEv1kLvEqm/YN3OGAgsi58='
WHERE
key_id = '5a8df9bb0703d566d1b1044ae951f560da28d8ba8428358eebb009e487b1c728'
AND (
token = 'xTp0qXe7RnQ9myzR59QMCGEv1kLvEqm/YN3OGAgsi58='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)