UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9SNTBImc5cFDn89YSHAyeHu76aHxM7+KlwIThM2oLn0='
WHERE
key_id = 'c425be3c22a03aad91cf33cd0b95c010343c14fd7c5ee202fa30a5390cdc02de'
AND (
token = '9SNTBImc5cFDn89YSHAyeHu76aHxM7+KlwIThM2oLn0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)