UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OSGnYwWqjNcj5ikMv+WxrSWtd5HfI2AKjibp2b/52K0='
WHERE
key_id = 'afb4dbca685919ad1ce93c70cc4bac2124ffe639ec5373e1d13d0cfd21921e64'
AND (
token = 'OSGnYwWqjNcj5ikMv+WxrSWtd5HfI2AKjibp2b/52K0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)