UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tpeqXuqM4SpnCr/M+LvPsT3ZYD5zOrez7wqEO1O5GOs='
WHERE
key_id = 'ead9fbe608f1920cdc586ac2be363e533b1fee6ea0c880c1d39e1594369a3d43'
AND (
token = 'tpeqXuqM4SpnCr/M+LvPsT3ZYD5zOrez7wqEO1O5GOs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)