UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mBY9As+kJ/pQW9qPNm4QTNOWdiADFGMGsMbZw5Xqn9Q=' 
WHERE 
  key_id = 'f7a320f6331d8d92379be22feb9b93e88a92aaacfdc3c7ceb2c9d0a313947fa5' 
  AND (
    token = 'mBY9As+kJ/pQW9qPNm4QTNOWdiADFGMGsMbZw5Xqn9Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030