UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+7qZfwYQxZKJqqgjvIVwbu1QRrmSsLWTf3F6CfDu0Go=' 
WHERE 
  key_id = '0fca16ad2b065deca6172ff7596a888a5f4af1f8ac02d8ef5c708f5ca72336b3' 
  AND (
    token = '+7qZfwYQxZKJqqgjvIVwbu1QRrmSsLWTf3F6CfDu0Go=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026