UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0C1zxC6pOynlb+ze6bmfIC/2Pt8r5oGnyUFBswGYdYQ=' 
WHERE 
  key_id = '0d79d045fd54ae0fb3f68d67528648a985e5c8dbafe0ac535d15d14fe3767e21' 
  AND (
    token = '0C1zxC6pOynlb+ze6bmfIC/2Pt8r5oGnyUFBswGYdYQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039