UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yUDoQQvQK5nzJ92zI6123ceRq07OIgvCqm/wJLZoVpo='
WHERE
key_id = '744a2eb9c9aa3bcde0f335a732444fff86335cd530a35d940709698dc84ad653'
AND (
token = 'yUDoQQvQK5nzJ92zI6123ceRq07OIgvCqm/wJLZoVpo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)