UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'N6Evgkt8GBtjRFhkM/jKyLi9F1WZx7Mc08pcc3tDVvA=' 
WHERE 
  key_id = '21c54c93682f17102ebd58bc0f390c9b8a7f7bb5258a701396561eac7c798e34' 
  AND (
    token = 'N6Evgkt8GBtjRFhkM/jKyLi9F1WZx7Mc08pcc3tDVvA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029