UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AYtY/ISatTmZSE+f17Oge42g2ynuKWPq5ESH/Ba9Lck=' 
WHERE 
  key_id = '75a8f85493dd0e4866ad2ca44d56d1abb70f5931f14944581cdf656f8723ac49' 
  AND (
    token = 'AYtY/ISatTmZSE+f17Oge42g2ynuKWPq5ESH/Ba9Lck=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047