UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qrLKQLhYCJlczGRYREoD2GRdjdEFpHAKvul1Gm/4NIU=' 
WHERE 
  key_id = '96d2ed84c607a7236d47cd3104e0de125d93fa827954f03a540a7b88a6f15369' 
  AND (
    token = 'qrLKQLhYCJlczGRYREoD2GRdjdEFpHAKvul1Gm/4NIU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041