UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oullOyybHpdoluwfd9N0WZeylnYO51YMVkPX9fcjs+s='
WHERE
key_id = '02dd58fdc764a52df211aef095455a58c7f5b50117a3b8ae3f24e6a812a6a18c'
AND (
token = 'oullOyybHpdoluwfd9N0WZeylnYO51YMVkPX9fcjs+s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)