UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mB3vHuZIWBNuLsffwRgrIqm738bung7bVnCdzr3tyHg='
WHERE
key_id = '6eb40ab6af1c586253f18539530b2d7538c2d44bf761ad1df01fc05d4a5695dc'
AND (
token = 'mB3vHuZIWBNuLsffwRgrIqm738bung7bVnCdzr3tyHg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)