UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '545fmcwM1SX+pORvEGAfG3R1+FvOieBqn23dCNQFj7I='
WHERE
key_id = '803e05b95be8aef21765981b87c5cc4c437f94f12b7e4120fa643a7c8506402e'
AND (
token = '545fmcwM1SX+pORvEGAfG3R1+FvOieBqn23dCNQFj7I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)