UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bGxFpXKefMvewzA3pSx5lOaNlFze7BNLWBL1EUz9+bE=' 
WHERE 
  key_id = '10db2228343ed02a2f275148809b76a52f2a2a6741d4f6cec1c53a166f6dcb27' 
  AND (
    token = 'bGxFpXKefMvewzA3pSx5lOaNlFze7BNLWBL1EUz9+bE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030