UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3WJYH4MXidzGuiLigTjctnhCG9eF2r4vGxEWfjN17So='
WHERE
key_id = 'c0b1885f5ffb48e4646ed1da388951b8c873c884dc547d2a1dc289c437214b53'
AND (
token = '3WJYH4MXidzGuiLigTjctnhCG9eF2r4vGxEWfjN17So='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)