UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vugMGcE1Ua+dfYdBDKzLBhH4CJ9gJMgZqz8hjX2T12o=' 
WHERE 
  key_id = '7e0778668ad4e2c1bab1f0cdc48dbfa58b37d10e04b5f905ffa65286c89c38c4' 
  AND (
    token = 'vugMGcE1Ua+dfYdBDKzLBhH4CJ9gJMgZqz8hjX2T12o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028