UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Wbgv/v787VNRe3ohQlULsIc0R0804PqEfOPyTt11aYM=' 
WHERE 
  key_id = '0b8ef04306bb1cd8154b3f33cfbe31ed45f9c054c024b00eb94c30eecd55cfe5' 
  AND (
    token = 'Wbgv/v787VNRe3ohQlULsIc0R0804PqEfOPyTt11aYM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017